package com.yq.dao;

import com.yq.entity.CompanyName;
import com.yq.entity.Healthregistration;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.yq.entity.HealthregistrationAll;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author IceZhang
 * @since 2020-02-28
 */
@Mapper
public interface HealthregistrationDao extends BaseMapper<Healthregistration> {
    @Select("SELECT count(*) as num,companyname FROM healthregistration GROUP BY companyname")
    List<CompanyName> getcompanyname();

    @Select("SELECT  c.commnuityname as communitynamea,h.* FROM communitye c LEFT JOIN healthregistration h ON c.id = h.communityid")
    List<HealthregistrationAll> allmsg();

}
